from datetime import datetime
from pydantic import BaseModel, Field
from typing import Optional

class XmUserBase(BaseModel):
    alipayAccount: str = Field(default="", max_length=64, description="支付宝账号")
    alipayName: str = Field(default="", max_length=64, description="支付宝姓名")
    bankCardNumber: str = Field(default="", max_length=64, description="银行账号")
    bankName: str = Field(default="", max_length=64, description="银行名称")
    certificationStatus: int = Field(default=0, description="认证状态")
    certificationTime: datetime = Field(default_factory=datetime.now, description="认证时间")
    city: str = Field(default="", max_length=128, description="城市")
    createTime: datetime = Field(default_factory=datetime.now, description="创建时间")
    email: str = Field(default="", max_length=128, description="邮箱")
    growthScore: int = Field(default=0, description="赚力值")
    hasJintanToken: bool = Field(default=False, description="是否有鲸探Token")
    headImg: str = Field(default="", max_length=255, description="头像")
    highQualityUserMedalImg: str = Field(default="", max_length=255, description="高质量用户勋章图片")
    idCard: str = Field(default="", max_length=64, description="身份证号")
    isCertification: bool = Field(default=False, description="是否认证")
    isHfPayOpen: bool = Field(default=False, description="是否开启支付")
    isHidePhone: bool = Field(default=False, description="是否隐藏手机号")
    isHighQualityUser: bool = Field(default=False, description="是否高质量用户")
    isInWithdrawBlacklist: bool = Field(default=False, description="是否在提现黑名单")
    isOpenTransportAccount: bool = Field(default=False, description="是否开启运输账号")
    jtPhone: str = Field(default="", max_length=32, description="鲸探手机号")
    memberLevel: int = Field(default=0, description="会员等级")
    memberLevelImg: str = Field(default="", max_length=255, description="会员等级图片")
    memberLevelName: str = Field(default="", max_length=64, description="会员等级名称")
    nickName: str = Field(default="", max_length=64, description="昵称")
    openBank: str = Field(default="", max_length=128, description="开户行")
    openid: str = Field(default="", max_length=128, description="开放平台ID")
    phone: str = Field(default="", max_length=32, description="手机号")
    province: str = Field(default="", max_length=64, description="省份")
    realName: str = Field(default="", max_length=64, description="真实姓名")
    rentHireEarnestMagnification: float = Field(default=0.0, description="出租雇佣保证金倍率")
    sellEarnestMoneyStatus: int = Field(default=0, description="出售保证金状态")
    sex: int = Field(default=0, description="性别")
    token: str = Field(default="", max_length=255, description="用户合作方Token")
    transportOpenAccountStatus: str = Field(default="", max_length=32, description="运输账号状态")
    uid: int = Field(default=0, description="用户UID")
    userOrderType: int = Field(default=0, description="用户交易类型")
    internalUid: int = Field(default=0, description="内部用户UID")

class XmUserCreate(XmUserBase):
    pass

class XmUserUpdate(BaseModel):
    alipayAccount: Optional[str] = Field(default=None, max_length=64, description="支付宝账号")
    alipayName: Optional[str] = Field(default=None, max_length=64, description="支付宝姓名")
    bankCardNumber: Optional[str] = Field(default=None, max_length=64, description="银行账号")
    bankName: Optional[str] = Field(default=None, max_length=64, description="银行名称")
    certificationStatus: Optional[int] = Field(default=None, description="认证状态")
    certificationTime: Optional[datetime] = Field(default=None, description="认证时间")
    city: Optional[str] = Field(default=None, max_length=128, description="城市")
    createTime: Optional[datetime] = Field(default=None, description="创建时间")
    email: Optional[str] = Field(default=None, max_length=128, description="邮箱")
    growthScore: Optional[int] = Field(default=None, description="赚力值")
    hasJintanToken: Optional[bool] = Field(default=None, description="是否有鲸探Token")
    headImg: Optional[str] = Field(default=None, max_length=255, description="头像")
    highQualityUserMedalImg: Optional[str] = Field(default=None, max_length=255, description="高质量用户勋章图片")
    idCard: Optional[str] = Field(default=None, max_length=64, description="身份证号")
    isCertification: Optional[bool] = Field(default=None, description="是否认证")
    isHfPayOpen: Optional[bool] = Field(default=None, description="是否开启支付")
    isHidePhone: Optional[bool] = Field(default=None, description="是否隐藏手机号")
    isHighQualityUser: Optional[bool] = Field(default=None, description="是否高质量用户")
    isInWithdrawBlacklist: Optional[bool] = Field(default=None, description="是否在提现黑名单")
    isOpenTransportAccount: Optional[bool] = Field(default=None, description="是否开启运输账号")
    jtPhone: Optional[str] = Field(default=None, max_length=32, description="鲸探手机号")
    memberLevel: Optional[int] = Field(default=None, description="会员等级")
    memberLevelImg: Optional[str] = Field(default=None, max_length=255, description="会员等级图片")
    memberLevelName: Optional[str] = Field(default=None, max_length=64, description="会员等级名称")
    nickName: Optional[str] = Field(default=None, max_length=64, description="昵称")
    openBank: Optional[str] = Field(default=None, max_length=128, description="开户行")
    openid: Optional[str] = Field(default=None, max_length=128, description="开放平台ID")
    phone: Optional[str] = Field(default=None, max_length=32, description="手机号")
    province: Optional[str] = Field(default=None, max_length=64, description="省份")
    realName: Optional[str] = Field(default=None, max_length=64, description="真实姓名")
    rentHireEarnestMagnification: Optional[float] = Field(default=None, description="出租雇佣保证金倍率")
    sellEarnestMoneyStatus: Optional[int] = Field(default=None, description="出售保证金状态")
    sex: Optional[int] = Field(default=None, description="性别")
    token: Optional[str] = Field(default=None, max_length=255, description="用户合作方Token")
    transportOpenAccountStatus: Optional[str] = Field(default=None, max_length=32, description="运输账号状态")
    uid: Optional[int] = Field(default=None, description="用户UID")
    userOrderType: Optional[int] = Field(default=None, description="用户交易类型")

class XmUserPublic(XmUserBase):
    pass
